package site.suimu.service.impl;

import org.springframework.stereotype.Service;
import site.suimu.mapper.TUserMapper;
import site.suimu.pojo.TUser;
import site.suimu.service.TUserService;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TUserServiceImpl implements TUserService {

    @Resource
    TUserMapper tUserMapper;

    public boolean insUser(TUser tUser) {
        if(tUserMapper.createUser(tUser)>0){
            return true;
        }
        return false;
    }

    public boolean login(TUser tUser) {
        if(tUserMapper.selectUser(tUser)!=null){
            return true;
        }
        return false;
    }

    public boolean upd(TUser tUser) {
        if(tUserMapper.updateUser(tUser)>0){
            return true;
        }
        return false;
    }

    public boolean dleUser(int uid) {
        if(tUserMapper.deleteUser(uid)>0){
            return true;
        }
        return false;
    }

    public List<TUser> selUserList() {
        return tUserMapper.userList();
    }
}
